package chapter04;

public class java02_Object_2 {
    public static void main(String[] args) {

        Teacher t1 = new Teacher();
        t1.name = "张三";
        t1.teach();

        Student s1 = new Student();
        s1.name = "李四";
        s1.student();
    }
}

class Teacher {
    String name;

    void teach() {
        System.out.println(name + "老师在讲课");
    }
}


class Student {
    String name;

    void student() {
        System.out.println(name + "学生在听课");
    }
}